package dao

import (
	"goblog/models"
	"github.com/astaxie/beego/orm"
)

type MpConfigDao struct {
	Dao orm.Ormer
}

func (this *MpConfigDao) Get(id int) models.MpConfig {
	if this.Dao == nil {
		this.Dao = orm.NewOrm()
	}
	var config models.MpConfig
	this.Dao.Raw(`SELECT id, app_id, name, secret, token, aes_key, access_token, expires_time,
		js_api_ticket, js_expires_time, partner_id, partner_key, cert_path,cert_pass, salt
		FROM
		mp_config
		WHERE
		id = ?`, id).QueryRow(&config)
	return config
}
